package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/7/3.
 */
@Entity
@Table(name = "goods_class", schema = "", catalog = "jbmcore")
public class GoodsClassEntity extends IAcross
{
    public GoodsClassEntity()
    {
        super();
    }

    public GoodsClassEntity(IAcross ia)
    {
        super(ia);
    }
    private int gcId;
    private String gcCode;
    private String gcName;
    private String gcType;
    private Timestamp createDate;
    private int createId;
    private Timestamp expireDate;
    private Timestamp closeDate;
    private Integer closeId;
    private List<GoodsClassEntity> goodsClassEntityList;

    @Id
    @Column(name = "gc_id")
    @GeneratedValue
    public int getGcId() {
        return gcId;
    }

    public void setGcId(int gcId) {
        this.gcId = gcId;
    }

    @Basic
    @Column(name = "gc_code")
    public String getGcCode() {
        return gcCode;
    }

    public void setGcCode(String gcCode) {
        this.gcCode = gcCode;
    }

    @Basic
    @Column(name = "gc_name")
    public String getGcName() {
        return gcName;
    }

    public void setGcName(String gcName) {
        this.gcName = gcName;
    }

    @Basic
    @Column(name = "gc_type")
    public String getGcType() {
        return gcType;
    }

    public void setGcType(String gcType) {
        this.gcType = gcType;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "create_id")
    public int getCreateId() {
        return createId;
    }

    public void setCreateId(int createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "expire_date")
    public Timestamp getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(Timestamp expireDate) {
        this.expireDate = expireDate;
    }

    @Basic
    @Column(name = "close_date")
    public Timestamp getCloseDate() {
        return closeDate;
    }

    public void setCloseDate(Timestamp closeDate) {
        this.closeDate = closeDate;
    }

    @Basic
    @Column(name = "close_id")
    public Integer getCloseId() {
        return closeId;
    }

    public void setCloseId(Integer closeId) {
        this.closeId = closeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GoodsClassEntity that = (GoodsClassEntity) o;

        if (createId != that.createId) return false;
        if (gcId != that.gcId) return false;
        if (closeDate != null ? !closeDate.equals(that.closeDate) : that.closeDate != null) return false;
        if (closeId != null ? !closeId.equals(that.closeId) : that.closeId != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (expireDate != null ? !expireDate.equals(that.expireDate) : that.expireDate != null) return false;
        if (gcCode != null ? !gcCode.equals(that.gcCode) : that.gcCode != null) return false;
        if (gcName != null ? !gcName.equals(that.gcName) : that.gcName != null) return false;
        if (gcType != null ? !gcType.equals(that.gcType) : that.gcType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = gcId;
        result = 31 * result + (gcCode != null ? gcCode.hashCode() : 0);
        result = 31 * result + (gcName != null ? gcName.hashCode() : 0);
        result = 31 * result + (gcType != null ? gcType.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + createId;
        result = 31 * result + (expireDate != null ? expireDate.hashCode() : 0);
        result = 31 * result + (closeDate != null ? closeDate.hashCode() : 0);
        result = 31 * result + (closeId != null ? closeId.hashCode() : 0);
        return result;
    }

    @Transient
    public List<GoodsClassEntity> getGoodsClassEntityList() {
        return goodsClassEntityList;
    }

    public void setGoodsClassEntityList(List<GoodsClassEntity> goodsClassEntityList) {
        this.goodsClassEntityList = goodsClassEntityList;
    }
}
